<?php
class OrdenInspeccion extends AppModel {
    var $name = 'OrdenInspeccion';
    var $displayField = 'correlativo';
    public $actsAs = array('Search.Searchable');
    public $filterArgs = array(array('name' => 'empresa', 'type' => 'like'));


    //The Associations below have been created with all possible keys, those that are not needed can be removed

    var $order = 'OrdenInspeccion.mes desc, OrdenInspeccion.anio desc, OrdenInspeccion.correlativo asc';
    var $validate = array(
            'correlativo' => array(
                            'rule' => 'numeric',
                            'required' => true,
                            'message' => 'Correlativo no puede quedar vacio',
                            'allowEmpty'=>false
    ));

    var $belongsTo = array(
            'TipoOrdenInspeccion' => array(
                            'className' => 'TipoOrdenInspeccion',
                            'foreignKey' => 'tipo_orden_inspeccion_id',
                            'conditions' => '',
                            'fields' => '',
                            'order' => ''
            )
    );

    var $hasMany = array(
            'OrdenInspeccionComentario' => array(
                            'className' => 'OrdenInspeccionComentario',
                            'foreignKey' => 'orden_inspeccion_id',
                            'dependent' => false,
                            'conditions' => '',
                            'fields' => '',
                            'order' => '',
                            'limit' => '',
                            'offset' => '',
                            'exclusive' => '',
                            'finderQuery' => '',
                            'counterQuery' => ''
            ),
            'OrdenTrabajo' => array(
                            'className' => 'OrdenTrabajo',
                            'foreignKey' => 'orden_inspeccion_id',
                            'dependent' => false,
                            'conditions' => '',
                            'fields' => '',
                            'order' => '',
                            'limit' => '',
                            'offset' => '',
                            'exclusive' => '',
                            'finderQuery' => '',
                            'counterQuery' => ''
            ),
            'Requisicion' => array(
                            'className' => 'Requisicion',
                            'foreignKey' => 'orden_inspeccion_id',
                            'dependent' => false,
                            'conditions' => '',
                            'fields' => '',
                            'order' => '',
                            'limit' => '',
                            'offset' => '',
                            'exclusive' => '',
                            'finderQuery' => '',
                            'counterQuery' => ''
            ),
            'Presupuesto' => array(
                            'className' => 'Presupuesto',
                            'foreignKey' => 'orden_inspeccion_id',
                            'dependent' => false,
                            'conditions' => '',
                            'fields' => '',
                            'order' => '',
                            'limit' => '',
                            'offset' => '',
                            'exclusive' => '',
                            'finderQuery' => '',
                            'counterQuery' => ''
            )

    );

}
?>